#include"Processbar.h"


#define style '#'
const  char* lable = "|/-\\"; 
void ProBar(double total,double current)
{

  
  double rate  = (current*100/total); 
  int loop_count = (int)rate; 
  int cnt = 0;
  char bar[101];
  int len = strlen(lable);
  memset(bar,'\0',sizeof(bar));
  while(cnt<=loop_count)
  {
    bar[cnt++] = style;

  }
    printf("[%-100s][%.1lf%%][%c]\r",bar,rate,lable[cnt%len]);
    fflush(stdout);
    usleep(20000);
}
